package com.yan.demo.arrydemo;

import java.util.Arrays;
import java.util.Random;

/*
    i   次方   i   次方
    4    0     5    0
    3    1
    2    2
*/
public class ArrayTest4 {
    public static void main(String[] args) {
        Random r = new Random();
        int num = 0;
        int[] arr = new int[5];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = r.nextInt(10);
        }
        for (int i = arr.length - 1; i >= 0; i--) {
            num += arr[i] * (int)(Math.pow(10, (arr.length-1 - i)));
        }
            System.out.println(Arrays.toString(arr));
            System.out.println("表示的整数为" + num);
    }
}
